package com.example.mapper;

import com.example.entity.singerAndGame.GameStatistics;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GameStatisticsMapper {

    @Select("select * from game_statistics where gid = #{gid} order by score")
    List<GameStatistics> getGameStatisticsByGid(int gid);

    @Insert("insert into game_statistics(gid, sid, count, score) values(#{gid}, #{sid}, #{count}, #{score})")
    Integer addGameStatistics(GameStatistics voteStatistics);

    @Delete("delete from game_statistics where gid = #{gid}")
    Integer deleteGameStatisticsByGid(int gid);

}
